1. Field of the Invention
The present invention relates to a data storage apparatus, and more particularly, to a data storage apparatus that stores data designated by a user in rewritable recording media such as CD-RW (Compact Disc-ReWritable) and DVD+RW (Digital Video or Versatile Disc+ReWritable).
2. Description of the Related Art
Universal Disc Format (UDF) is a standard file system for rewritable data storage media such as CD-RW and DVD+RW. UDF is applicable to various data storage apparatuses since UDF uses various recording formats suitable to respective recording media.
Among UDF, random UDF is used for CD-RW and DVD+RW that are randomly accessible as well as rewritable.
In the case of CD-RW, it is necessary to format a disk by writing dummy data in the entire recording region or at least a designated recording region of the disk in order to write or to read data at random. In the case of DVD+RW, an unrecorded region of a disk also must be formatted by storing dummy data in advance to establish compatibility with conventional DVD-ROM drives.
Another object of formatting is to detect an inherent defect in the disk in order to avoid the writing of data in the defective region when real data are written.
That is, a data storage apparatus verifies the dummy data written in the entire region of the disk that has been formatted. This is called certifying processing.
A sector in which a defect is found by the certifying processing is registered as a defective sector, and its information is stored in a predetermined area of the disk. In the case that the defective sector is to be accessed for the writing or reading of data, another sector in which no defect was found by certifying is accessed on behalf of the defective sector. A method of detecting a defective sector in a disk is described in Japanese Laid-open Patent Application No. 7-176142, for example, as related art.
As described above, while a disk is being formatted, the data storage apparatus writes dummy data in the entire region or at least a designated region of the disk and verifies the dummy data, if necessary. The time required for formatting the disk increases proportionally to the increase of memory capacity of the disk.
As a solution to this problem, a data storage apparatus that performs the formatting of a CD-RW disk and/or a DVD+RW disk in the background so that a user could write and/or read data in a short time period after the user requests to format the disk is proposed in the Japanese Laid-open Patent Application No. 11-134799, for example.
While no user data are being written or read in the disk, the proposed data storage apparatus writes dummy data in an unformatted region, or verifies the dummy data written in a formatted region to certify the formatted region. If the user requests to write/read user data while the disk is being formatted in the background, the data storage apparatus temporarily stops (suspends) the formatting processing and writes/reads the user data in compliance with the user's request. Accordingly, the data storage apparatus, while formatting the disk in the background, performs the writing and reading of the user data, the writing of the dummy data, and the detecting of a defective sector by the certifying processing in parallel.
In the case of the formatting in the background according to related art, however, the data storage apparatus writes user data in an uncertified region, which may be a defective sector. If the uncertified region is defective, the user data may be lost.